package com.zhixi.pattern.notimportant.adapterpattern.operation;

/**
 * 手机
 *
 * @作者 ShuHaoNan
 * @邮箱 shuhaonan1@gmail.com
 * @时间 2020/11/17 17:07
 */
public class Phone extends VoltageAdapter {

    public Phone(IVoltage220V voltage220V) {
        super(voltage220V);
    }

    /**
     * 充电
     */
    public void charging(Voltage5V voltage5V) {
        if (voltage5V.output5V() == 5) {
            System.out.println("电压5V，可以充电");
        } else if (voltage5V.output5V() > 5) {
            System.out.println("电压大于5V，无法充电");
        }
    }

}
